<?php
namespace app\admin\validate;

use think\Validate;
use Session;

class Login extends Validate
{
    protected $rule =   [
        'username'  => 'require|alphaDash',
        'password'   => 'length:4,25',

    ];

    protected $message  =   [
        'username.require' => '用户名必须填写',
        'username.alphaDash' => '用户名格式错误',
        'password'     => '密码长度不符合，4-25个字符',

    ];


    public function checkDo($param){

        $sessionVerify = Session::pull('LoginVerify');

        if(md5($param['verify']) != $sessionVerify){
            exception('验证码错误！');
        }


        return $this->check($param);
    }



}